//
//  CZHookInject.m
//  CZHook
//
//  Created by czera on 2020/4/15.
//  Copyright © 2020 czera. All rights reserved.
//

#import "CZHookInject.h"
#import <objc/runtime.h>

@implementation CZHookInject

+(void)load{
    NSLog(@"来了 。。。。 ");
    //错误写法，注意 "WCAccountLoginControlLogic" 前面不能加@
//    Method oldMethod = class_getInstanceMethod(objc_getClass(@"WCAccountLoginControlLogic"), @selector(onFirstViewRegester));

    Method oldMethod = class_getInstanceMethod(objc_getClass("WCAccountLoginControlLogic"), @selector(onFirstViewRegester));
    
    Method newMethod = class_getInstanceMethod(self, @selector(CZHookOnFirstViewRegester));

    method_exchangeImplementations(oldMethod, newMethod);
}

-(void)CZHookOnFirstViewRegester{
    NSLog(@"检测到异常，不能注册!!!!!");
}

@end
